package enum_;
/*
体会enum实现接口
 */
public class Test05 {
    public static void main(String[] args) {
        Music.HOT.play();//播放Pop音乐
        Music.HIT.play();//播放Hit音乐
    }
}
interface IPlay{
    void play();
}
enum Music implements IPlay{
    HIT("Hit"),
    HOT("Pop");
    private String name;
    Music(String name){
        this.name = name;
    }

    @Override
    public void play() {
        System.out.println("播放"+name+"音乐");
    }
}
